package main

import (
	"fmt"
	"regexp"
)

func main2() {
	text := "学习Golang"

	match, _ := regexp.MatchString("\\p{Han}", text)
	fmt.Println("是否匹配：", match)

	match, _ = regexp.MatchString(`\p{Han}`, text)
	fmt.Println("是否匹配：", match)

	reg := regexp.MustCompile(`[\p{Han}]+`)
	reg = regexp.MustCompile(`[\p{Hangul}]+`)
	fmt.Printf("%q\n", reg.FindAllString(text, -1))

	reg = regexp.MustCompile(`[:upper:][:lower:]`)
	fmt.Printf("%q\n", reg.FindAllString(text, -1))
	//fmt.Println(reg.FindString(text))

	reg = regexp.MustCompile(`\p{Han}`)
	fmt.Printf("%q\n", reg.FindAllString(text, -1))

	//reg = regexp.MustCompile(`[\x{4E00}-\x{9FA5}]`)
	//fmt.Printf("%q\n", reg.FindAllString(text, -1))r
	//
	//reg = regexp.MustCompile(`[\x{3400}-\x{4db5}]`)
	//fmt.Printf("%q\n", reg.FindAllString(text, -1))

	fmt.Printf("%x\n", rune('中'))

	reg = regexp.MustCompile(`\x{4E2D}`)
	fmt.Printf("%q\n", reg.FindAllString(text, -1))

}
